<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Blog博客</title>

    <div th:include="commen :: #common_link"></div>
</head>

<body>
<div th:include="commen :: #common_nav"></div>
<!-- Page Header -->
<header class="masthead" style="background-image: url('/images/image3.jpg')">
    <div class="overlay"></div>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-10 mx-auto">
                <div class="site-heading">
                    <h1 th:text="${tag.getName()}"></h1>
                    <span class="subheading">WELCOME TO CREATIVITY</span>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- Main Content -->
<div class="container">
    <div class="row">
        <div class="col-lg-8 col-md-10 mx-auto">
            <div th:if="${blogList.list == null}">
                <h1>对不起，该标签下还没有博客</h1>
            </div>
            <div class="post-preview" th:each="blog:${blogList.list}">
                <a th:href="@{blogDetail(id=${blog.getNid()})}">
                    <h2 class="post-title" th:text="${blog.getTitle()}"></h2>
                    <h3 class="post-subtitle" th:text="${blog.getSubtitle()}"></h3>
                </a>
                <p class="post-meta">
                    由 <a href="#" th:text="${userService.queryById(blog.getUser_id()).getName()}"></a>
                    发表于 [[${blog.getPublic_time()}]]</p>
                <hr>
            </div>
            <!-- Pager -->
            <div class="clearfix" align="right">
                <a th:href="@{showByTag(pageNo=1,tagID=${tag.getNid()})}" class="btn btn-primary">第一页</a>
                <a th:if="${not blogList.isFirstPage}" th:href="@{showByTag(pageNo=${blogList.pageNum-1},tagID=${tag.getNid()})}" class="btn btn-primary">上一页</a>
                <a th:if="${not blogList.isLastPage}" th:href="@{showByTag(pageNo=${blogList.pageNum+1},tagID=${tag.getNid()})}" class="btn btn-primary">下一页</a>
                <a th:href="@{showByTag(pageNo=${blogList.pages},tagID=${tag.getNid()})}" class="btn btn-primary">最后页</a>
            </div>
        </div>
    </div>
</div>

<div th:include="commen :: #common_footer"></div>

</body>
</html>
